/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.LoggedData;

/**
 *
 * @author DOStudent1
 */
public class LogableNumber implements LogableObject {
    
    private Long number=null;
    private boolean isSet=false;
    
    public LogableNumber() {
    }
    
    public LogableNumber fromNumber(Long number) {
        LogableNumber res=new LogableNumber();
        res.number=number;
        res.isSet=true;
        return(res);
    }

    
    public boolean isSet() {
        return(isSet);
    }
    
    
    
    public Long getNumber() {
        if (!isSet) {
            throw new RuntimeException("Not initialized");
        }
        return(number);
    }

    public LoggedLogableObject toLoggedMyObject() {
        LoggedLogableNumber loggedMyNumber=new LoggedLogableNumber();
        return(loggedMyNumber.fromLogableObject(this));
    }

    public boolean isEmpty() {
        return(number==null);
    }

}
